//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.baidu.trace.b;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import com.baidu.trace.c.e;

public final class c extends BroadcastReceiver {
    public c() {
    }

    public final void onReceive(Context var1, Intent var2) {
        if(var1 != null && var2 != null) {
            String var3 = var2.getAction();
            if("android.net.conn.CONNECTIVITY_CHANGE".equals(var3) || "com.baidu.trace.action.SOCKET_RECONNECT".equals(var3)) {
                NetworkInfo var4 = ((ConnectivityManager)var1.getApplicationContext().getSystemService("connectivity")).getActiveNetworkInfo();
                if(var4 != null && var4.isConnected() && var4.isAvailable()) {
                    int var5 = var4.getType();
                    if(d.h() && e.b() - d.i() > 60L) {
                        d.a(false);
                    }

                    if((d.a(var5) || d.a(var1)) && !d.h()) {
                        d.b(var5);
                        d.a(true);
                        d.a(e.b());
                        d.a().d();
                    }

                    return;
                }

                d.b(-2147483648);
            }

        }
    }
}
